#ifndef __OPENGL_RENDERER_H__
#define __OPENGL_RENDERER_H__

#include "IRenderer.h"
#include <Windows.h>
#include <gl\GL.h>
#include <gl\GLU.h>
#include "SOIL.h"
#include "IMesh.h"
//#include "IDGenerator.h"
#include <map>
#include <vector>

namespace steam
{

	namespace moon
	{
		class OpenGLRenderer : public IRenderer
		{
		public:

			typedef std::vector<firebox::Entity*> Entities;
			OpenGLRenderer();

			void render();

			unsigned int createAndRegisterMesh(const coal::IMesh* mesh);

			void setVisible(unsigned int id, bool visible);

			SkyBox& getSkyBox();

			void setTerrain(ITerrain* terrain);

			ITerrain* getTerrain();

			void setCamera( ICamera* camera );

			ICamera* getCamera();

			void registerBox( wheel::IBox* box );

		private:
			struct RenderInfo
			{
				unsigned int RenderId;

				bool IsVisible;			
			};

			unsigned int createRenderID(const coal::IMesh* mesh);

			typedef std::map<unsigned int, RenderInfo> RenderInfoMap;

			std::vector<wheel::IBox*> m_boxes;

			RenderInfoMap m_renderInfoMap;

			SkyBox m_skyBox;

			ITerrain* m_terrain;

			ICamera* m_camera;

			SMUInt m_idCounter;
		};
	}

}
#endif